//
//  UIViewController+YDAlert.h
//  Merchants
//
//  Created by Yigol on 2018/5/21.
//  Copyright © 2018年 yida. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

/**
 Alert类型

 - YDAlertTypeNotice: 通知
 - YDAlertTypeWarning: 警告
 - YDAlertTypeSuccess: 成功
 - YDAlertTypeSelective: 选择的
 */
typedef NS_ENUM(NSUInteger, YDAlertType) {
    YDAlertTypeNotice = 0,
    YDAlertTypeWarning,
    YDAlertTypeSuccess,
    YDAlertTypeSelective,
};

@interface UIViewController (YDAlert)

#pragma mark - ************ Simple
- (void)yd_showNoticeAlertWithMessage:(nullable NSString *)message handler:(void (^ __nullable)(void))hander;

- (void)yd_showWarningAlertWithMessage:(nullable NSString *)message handler:(void (^ __nullable)(void))hander;

- (void)yd_showSuccessAlertWithMessage:(nullable NSString *)message handler:(void (^ __nullable)(void))hander;

- (void)yd_showSelectiveAlertWithMessage:(nullable NSString *)message okHandler:(void (^ __nullable)(void))handler;

#pragma mark - ************ General
- (void)yd_showNoticeAlertWithTitle:(nullable NSString *)title message:(nullable NSString *)message handler:(void (^ __nullable)(void))hander;

- (void)yd_showWarningAlertWithTitle:(nullable NSString *)title message:(nullable NSString *)message handler:(void (^ __nullable)(void))hander;

- (void)yd_showSuccessAlertWithTitle:(nullable NSString *)title message:(nullable NSString *)message handler:(void (^ __nullable)(void))hander;

- (void)yd_showSelectiveAlertWithMessage:(nullable NSString *)message firstHandler:(void (^ __nullable)(void))firstHandler secondHandler:(void (^ __nullable)(void))secondHandler;

#pragma mark - ************ 通用
- (void)yd_showAlertWithTitle:(nullable NSString *)title
                      message:(nullable NSString *)message
                         type:(YDAlertType)type
             firstHandlerName:(nullable NSString *)firstName
            secondHandlerName:(nullable NSString *)secondName
                 firstHandler:(void (^ __nullable)(void))firstHandler
                secondHandler:(void (^ __nullable)(void))secondHandler;

#pragma mark - 消失

/**
 消失
 */
- (void)yd_dismiss;

/**
 延迟消失
 
 @param time 时间
 */
- (void)yd_dissmissAfter:(NSTimeInterval)time;

@end

NS_ASSUME_NONNULL_END
